import React from 'react'

export default function SecKill(props) {
  const { secKillArr } = props
  const listyle ={
    flex:1,
    listStyle:'none',
    overflow:'hidden'
  }
  // 处理价格函数
  const formatMoneyFn = (money)=>{
    return <span style={{
      fontSize:'12px',
      color:'red',
      marginLeft:'8px'
    }}>${money.toFixed(2)}</span>
  }
  return (
    <>
      <ul style={{
        display:'flex',
        marginTop:'18px'
      }}>
        {
          secKillArr.map(item => {
            return (
              <li key={item.proid} style={listyle}>
                <img src={ item.img1 } alt="" style={{
                  width:'100%',height:'100%'
                }}/>
                <p> { formatMoneyFn(item.originprice)} </p>
              </li>
            )
          })
        }

      </ul>
    </>
  )
}
